package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-10-24 9:43
 */
public class Test09 {
    public static void main(String[] args) {
        //flag=false
        //num=2
        //内层循环(i=2;i<=1)
        //num=3
        //内层循环(i=2;i<=2)    3%2
        //num=4
        //内层循环(i=2;i<=3)    4%2==0
        //num=5
        //内层循环(i=2;i<=5)    5%2!=0  5%3!=0  5%4!=0
        int count=0;
        boolean flag;
        for (int num=2;num<=100;num++) {
            //归零
            flag=true;
            for(int i=2;i<=num-1;i++){
                if(num%i==0){
                    flag=false;
                    break;
                }
            }
            if(flag){
                count++;
                System.out.print(num+"\t");
                if(count%5==0){
                    System.out.println();
                }
            }
        }
    }
}
